/*
** fill_obj_fcts2.c for  in /home/chreti_m//projet/RAYTRACER/init_cnf_file
** 
** Made by max chretien
** Login   <chreti_m@epitech.net>
** 
** Started on  Mon Apr 30 02:38:20 2012 max chretien
** Last update Mon Apr 30 17:16:58 2012 canh-kiet le
*/

#include	"rt.h"

void		obj_shiness(char **tab, t_obj *obj, int line_err)
{
  if (cnt_params(tab) != 2)
    disp_err(tab[0], line_err, "Only need 1 argument.\n");
  if (!my_str_isnum(tab[1]))
    disp_err(tab[0], line_err, "Argument must be only numbers.\n");
  obj->lim = atof(tab[1]);
}

void		obj_color(char **tab, t_obj *obj, int line_err)
{
  if (cnt_params(tab) != 2)
    disp_err(tab[0], line_err, "Only need 1 argument.\n");
  if (!my_str_isnum(tab[1]))
    disp_err(tab[0], line_err, "Argument must be only numbers.\n");
  obj->color = atoi(tab[1]);
}

void		obj_transm(char **tab, t_obj *obj, int line_err)
{
  if (cnt_params(tab) != 2)
    disp_err(tab[0], line_err, "Only need 1 argument.\n");
  if (!my_str_isnum(tab[1]))
    disp_err(tab[0], line_err, "Argument must be only numbers.\n");
  obj->transm = atof(tab[1]);
}

void		obj_absorb(char **tab, t_obj *obj, int line_err)
{
  if (cnt_params(tab) != 2)
    disp_err(tab[0], line_err, "Only need 1 argument.\n");
  if (!my_str_isnum(tab[1]))
    disp_err(tab[0], line_err, "Argument must be only numbers.\n");
  obj->absorb = atof(tab[1]);
}

void		obj_reflec(char **tab, t_obj *obj, int line_err)
{
  if (cnt_params(tab) != 2)
    disp_err(tab[0], line_err, "Only need 1 argument.\n");
  if (!my_str_isnum(tab[1]))
    disp_err(tab[0], line_err, "Argument must be only numbers.\n");
  obj->reflec = atof(tab[1]);
}
